<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>
<body>
    <div id='app'>
        <!-- <button v-on:click="alert1">点击</button>
        <button @mouseover="alert2">点击</button>
        <input type="text" @blur="alert3"> -->

            <hr>

            用户名：<input type="text" v-model="user"><br>
            密码<input type="password" v-model="pwd"><br>
            <button @click="btn">提交</button>

    </div>
    <script type='text/javascript'>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue',
                user:'用户名',
                pwd:''
            },
            methods: {
                //三种函数方法的简写写法
                alert1: function(e) {
                    alert(111)
                    
                },
                alert2:() => {
                    alert(222)
                },
                alert3() {
                    alert(333)
                },
                btn() {
                    console.log(this.user,this.pwd);
                }
            }
        });
    </script>
</body>
</html>